-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
screensaver: Look at $PKEXEC_UID not $USERHELPER_UID #5068
Conversation
/kickstart-test --testtype smoke |
What's the effect on boot.iso? |
According to @jkonecny12 this is not used on boot.iso, so hopefully it should not break it. |
/boot-iso --webui |
/kickstart-test --testtype smoke |
The inhibit call is done here https://github.com/rhinstaller/anaconda/blob/master/pyanaconda/startup_utils.py#L358 def live_startup():
"""Live environment startup tasks."""
inhibit_screensaver() From my grep call of the code this is the only call of this function so it should be pretty safe. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks!
pyanaconda/screensaver.py
Outdated
@@ -63,15 +63,15 @@ | |||
class SetEuidFromConsolehelper(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should ideally also rename this class but that could be done as follow up.
ACK, thanks for checking! :) |
Since commit 919be1d anaconda has been using pkexec instead of consolehelper to get root privileges on the live image. This caused a regression on the KDE live image, because anaconda was trying to inhibit the screensaver as the $USERHELPER_UID user which no longer gets set. This commit changes the code to use $PKEXEC_UID which is the polkit equivalent.
Since commit 919be1d anaconda has been using pkexec instead of consolehelper to get root privileges on the live image. pkexec more thoroughly cleans the environment before elevating privileges than consolehelper so DBUS_SESSION_BUS_ADDRESS gets expunged. Anaconda needs that variable to disable the screensaver (and for other reasons). This commit ensures it gets set explicitly after privileges have been raised.
5aa92b6
to
81b53cd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks for looking into this! :)
/kickstart-test --testtype smoke |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even better now.
# pkexec clears DBUS_SESSION_BUS_ADDRESS from environment | ||
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then | ||
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${PKEXEC_UID}/bus | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder how many of these issues could impact us. Anyway, let's go one by one :)
/boot-iso --webui |
|
|
@kparal suggested to also check whether inhibition of suspend is working. |
Since commit 919be1d anaconda has been using pkexec instead of consolehelper to get root privileges on the live image.
This caused a regression on the KDE live image, because anaconda was trying to inhibit the screensaver as the $USERHELPER_UID user which no longer gets set.
This commit changes the code to use $PKEXEC_UID which is the polkit equivalent.